home *** CD-ROM | disk | FTP | other *** search
- Title FLIP - prankware from NCR - GPSD
-
- ; Flip will read the command line, looking for the number of minutes to
- ; delay, if none is found, Flip will ask you for the delay time.
-
- ; after link, copy .exe to dummy, debug dummy, -m400 l8000 100, -w, -q
- ; copy dummy to .com and run .com Any int 10 with ah=0 will reset
-
-
- abs0 segment at 0
- org 4*8h
- timer_int dw 2 dup (?)
- org 4*10h
- video_int dw 2 dup (?)
- org 450h
- cursor_pos dw ?
-
- abs0 ends
-
- code segment
- org 100h
- assume cs:code, ds:code
- jmp start
-
- video_vector dw 2 dup (?)
- timer_vector dw 2 dup (?)
- save_screen dw 25*80 dup (?)
- hour dw 0
- min dw 30
- prompt_message db 'Enter the sleep time in minutes... $'
- input_buf db 3,0,' '
- immediate_flag db 0
- timer_count db 0ffh
- line db 0
- pos db 0
-
-
- start: push cs
- pop ds
-
- or byte ptr es:[80h],00
- jz ask
-
- mov cl,es:[80h]
- mov ch,0
- inc cx
- inc cx
- mov di,offset input_buf+1
- mov si,80h
- rep movsb
- jmp get_time
-
- ask: mov ah,9
- mov dx,offset prompt_message
- int 21h
- mov ah,0ah
- mov dx,offset input_buf
- int 21h
-
- get_time: mov ah,2ch
- int 21h
- mov al,ch
- mov ah,0
- mov hour,ax
- mov al,cl
- mov min,ax
- mov ax,0
- mov si,offset input_buf+2
- mov ch,0
- mov cl,input_buf+1
- get_offset: mov dl,[si]
- inc si
-
- cmp dl,'0'
- jb offset_loop
- cmp dl,'9'
- ja offset_loop
-
- mov bx,10
- push dx
- mul bx
- pop dx
- sub dl,30h
- mov dh,0
- add ax,dx
-
- offset_loop: loop get_offset
-
- cmp ax,0
- jne offset_done
-
- got_offset: mov cs:immediate_flag,0ffh
- jmp all_done
-
- offset_done: add min,ax
-
- do_mod_60: cmp min,60
- jb all_done
-
- sub min,60
- inc hour
- jmp do_mod_60
-
- all_done: sub ax,ax
- mov es,ax
- assume es:abs0
-
- mov ax,word ptr es:timer_int
- mov bx,word ptr es:timer_int+2
- mov cs:timer_vector, ax
- mov cs:timer_vector+2, bx
- cli
-
- mov word ptr es:timer_int, offset timer_handler
- mov word ptr es:timer_int+2, cs
-
- sti
-
- lea dx,prog_end
- int 27h
-
- timer_handler proc far
-
- assume cs:code, ds:nothing, es:nothing
-
- cmp immediate_flag,0
- je test_count
-
- mov immediate_flag,0
- push ax
- push bx
- push cx
- push dx
- push si
- push di
- push bp
- push es
- push ds
-
-
- jmp flip_screen
-
- test_count: inc timer_count
- jz timer_test
-
- jmp dword ptr timer_vector
-
- timer_test: push ax
- push bx
- push cx
- push dx
- push si
- push di
- push bp
- push es
- push ds
-
- sub ax,ax
- mov es,ax
-
- mov ax,es:[046eh]
- cmp ax,hour
- jne timer_test_2
-
- mov ax,es:[046ch]
- mov bx,1092
- mov dx,0
- div bx
- cmp ax,min
- je flip_screen
-
- timer_test_2: pop ds
- pop es
- pop bp
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- mov al,20h
- out 20h,al
- pop ax
- iret
-
- flip_screen: cli
-
- sub ax,ax
- mov es,ax
-
- mov ax,cs:timer_vector
- mov bx,cs:timer_vector+2
- mov word ptr es:timer_int,ax
- mov word ptr es:timer_int+2,bx
-
- sti
- mov al,20h
- out 20h,al
-
- mov ax,0b800h
- mov ds,ax
- mov cx,25*80
- mov di,offset save_screen
- mov si,0
- mov_sw_loop2: mov ax,ds:[si]
- mov cs:[di],ax
- inc si
- inc si
- inc di
- inc di
- loop mov_sw_loop2
-
- mov ax,es:cursor_pos
- push ax
-
- mov ax,6
- int 10h
-
- pop ax
- mov es:cursor_pos,ax
-
- mov si,offset save_screen
- mov cx,25
- mov di,7759
-
- line_loop: push si
- push cx
- push di
- call draw_line
- pop di
- pop cx
- pop si
- sub di,320
- add si,160
- loop line_loop
-
- mov ax,0
- mov es,ax
-
- mov ax,es:video_int
- mov bx,es:video_int+2
- mov video_vector,ax
- mov video_vector+2,bx
-
- mov word ptr es:video_int, offset video_handler
- mov word ptr es:video_int+2, cs
-
- pop ds
- pop es
- pop bp
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- pop ax
- iret
-
- timer_handler endp
-
- draw_line: mov cx,80
- draw_line_loop: mov al,cs:[si]
- inc si
- inc si
- push di
- push si
- push cx
- call draw_char
- pop cx
- pop si
- pop di
- dec di
-
- loop draw_line_loop
- ret
-
-
- draw_char: mov ah,0
- shl ax,1
- shl ax,1
- shl ax,1
- mov si,ax
- mov ax,0f000h
- mov es,ax
- add si,0fa6eh
- mov ax,0b800h
- mov ds,ax
-
- mov al,es:[si+7]
- call rotate
- mov ds:[di],al
-
- mov al,es:[si+6]
- call rotate
- mov ds:[di+2000h],al
-
- add di,80
-
- mov al,es:[si+5]
- call rotate
- mov ds:[di],al
-
- mov al,es:[si+4]
- call rotate
- mov ds:[di+2000h],al
-
- add di,80
-
- mov al,es:[si+3]
- call rotate
- mov ds:[di],al
-
- mov al,es:[si+2]
- call rotate
- mov ds:[di+2000h],al
-
- add di,80
-
- mov al,es:[si+1]
- call rotate
- mov ds:[di],al
-
- mov al,es:[si]
- call rotate
- mov ds:[di+2000h],al
-
- ret
-
- rotate: mov ah,0
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- shl al,1
- rcr ah,1
-
- mov al,ah
- ret
-
- video_handler proc far
-
- cmp ah,0
- jne video_2
-
- push ax
- push bx
- push es
- mov ax,0
- mov es,ax
- mov ax,video_vector
- mov bx,video_vector+2
- mov word ptr es:video_int,ax
- mov word ptr es:video_int+2,bx
-
- pop es
- pop bx
- pop ax
- mov al,2
- jmp dword ptr video_vector
-
- video_2: cmp ah,2
- jne video_3
-
- jmp dword ptr video_vector
- iret
-
- video_3: cmp ah,3
- jne video_4
-
- jmp dword ptr video_vector
- iret
-
- video_4: cmp ah,9
- jne video_5
-
- jmp write_char_attr
-
- video_5: cmp ah,10
- jne video_6
-
- jmp write_char_attr
-
- video_6: cmp ah,6
- jne video_7
-
- mov ah,7
- jmp video_99
-
- video_7: cmp ah,7
- jne video_8
-
- mov ah,6
- jmp video_99
-
- video_8:
- video_99: jmp dword ptr video_vector
-
- video_handler endp
-
- write_char_attr:
- push ds
- push es
- push bx
- push cx
- push dx
-
- push ax
-
- mov ax,0
- mov es,ax
- mov al,24
- sub al,byte ptr es:cursor_pos+1
- mov ah,0
- mov bx,320
- mul bx
- mov bl,79
- sub bl,byte ptr es:cursor_pos
- mov bh,0
- add ax,bx
- mov di,ax
-
- pop ax
- call draw_char
-
- pop dx
- pop cx
- pop bx
- pop es
- pop ds
- iret
-
-
- prog_end label byte
- code ends
- end